#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    long a, b, n, t, r, sum, min;
    scanf("%ld %ld", &a, &b);
    n = a * b;
    if (a > b)
    {
        t = b;
        b = a;
        a = t;
    }
    r = a % b;
    while (r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    min = n / b;
    sum = min + b;
    printf("%ld", sum);
    return 0;
}